home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / postit / postit4.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-10-26  |  13.2 KB  |  367 lines

  1. VERSION 4.00
  2. Begin VB.Form serverform 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H00C0C0C0&
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "PostIt Server 32 Bit Alpha 1a"
  7.    ClientHeight    =   4728
  8.    ClientLeft      =   1320
  9.    ClientTop       =   2208
  10.    ClientWidth     =   5472
  11.    BeginProperty Font 
  12.       name            =   "MS Sans Serif"
  13.       charset         =   0
  14.       weight          =   700
  15.       size            =   7.8
  16.       underline       =   0   'False
  17.       italic          =   0   'False
  18.       strikethrough   =   0   'False
  19.    EndProperty
  20.    ForeColor       =   &H80000008&
  21.    Height          =   5112
  22.    Icon            =   "POSTIT4.frx":0000
  23.    Left            =   1272
  24.    LinkMode        =   1  'Source
  25.    LinkTopic       =   "POSTIT"
  26.    MaxButton       =   0   'False
  27.    ScaleHeight     =   4728
  28.    ScaleWidth      =   5472
  29.    Top             =   1872
  30.    Width           =   5568
  31.    WindowState     =   1  'Minimized
  32.    Begin Threed.SSPanel Panel3D1 
  33.       Height          =   4716
  34.       Left            =   0
  35.       TabIndex        =   5
  36.       Top             =   0
  37.       Width           =   5484
  38.       _Version        =   65536
  39.       _ExtentX        =   9673
  40.       _ExtentY        =   8319
  41.       _StockProps     =   15
  42.       Caption         =   "Messages In Queue..."
  43.       BackColor       =   -2147483633
  44.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  45.          name            =   "Arial"
  46.          charset         =   0
  47.          weight          =   700
  48.          size            =   18
  49.          underline       =   0   'False
  50.          italic          =   0   'False
  51.          strikethrough   =   0   'False
  52.       EndProperty
  53.       BevelWidth      =   2
  54.       BevelInner      =   1
  55.       Alignment       =   6
  56.       Begin Threed.SSPanel Panel3D2 
  57.          Height          =   3660
  58.          Left            =   192
  59.          TabIndex        =   8
  60.          Top             =   480
  61.          Width           =   5100
  62.          _Version        =   65536
  63.          _ExtentX        =   8996
  64.          _ExtentY        =   6456
  65.          _StockProps     =   15
  66.          BackColor       =   -2147483633
  67.          BevelWidth      =   2
  68.          BevelInner      =   1
  69.          Alignment       =   6
  70.          Begin Threed.SSPanel Panel3D4 
  71.             Height          =   2220
  72.             Left            =   192
  73.             TabIndex        =   6
  74.             Top             =   864
  75.             Width           =   4716
  76.             _Version        =   65536
  77.             _ExtentX        =   8319
  78.             _ExtentY        =   3916
  79.             _StockProps     =   15
  80.             Caption         =   "Message"
  81.             BackColor       =   -2147483633
  82.             BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  83.                name            =   "Arial"
  84.                charset         =   0
  85.                weight          =   700
  86.                size            =   12
  87.                underline       =   0   'False
  88.                italic          =   0   'False
  89.                strikethrough   =   0   'False
  90.             EndProperty
  91.             BevelWidth      =   2
  92.             BevelInner      =   1
  93.             Alignment       =   6
  94.             Begin VB.Label Label2 
  95.                Appearance      =   0  'Flat
  96.                BackColor       =   &H0000FFFF&
  97.                BorderStyle     =   1  'Fixed Single
  98.                Caption         =   "Click on 'Check For New Messages' below to access your message queue (There may not be any messages though !)"
  99.                DataField       =   "MESSAGE"
  100.                DataSource      =   "Data1"
  101.                BeginProperty Font 
  102.                   name            =   "Arial"
  103.                   charset         =   0
  104.                   weight          =   700
  105.                   size            =   12
  106.                   underline       =   0   'False
  107.                   italic          =   0   'False
  108.                   strikethrough   =   0   'False
  109.                EndProperty
  110.                ForeColor       =   &H80000008&
  111.                Height          =   1644
  112.                Left            =   192
  113.                TabIndex        =   10
  114.                Top             =   384
  115.                Width           =   4332
  116.             End
  117.          End
  118.          Begin Threed.SSPanel Panel3D3 
  119.             Height          =   684
  120.             Left            =   192
  121.             TabIndex        =   11
  122.             Top             =   192
  123.             Width           =   4716
  124.             _Version        =   65536
  125.             _ExtentX        =   8319
  126.             _ExtentY        =   1207
  127.             _StockProps     =   15
  128.             Caption         =   "From"
  129.             BackColor       =   -2147483633
  130.             BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  131.                name            =   "Arial"
  132.                charset         =   0
  133.                weight          =   700
  134.                size            =   12
  135.                underline       =   0   'False
  136.                italic          =   0   'False
  137.                strikethrough   =   0   'False
  138.             EndProperty
  139.             BevelWidth      =   2
  140.             BevelInner      =   1
  141.             Alignment       =   1
  142.             Begin VB.Label Label1 
  143.                Appearance      =   0  'Flat
  144.                BackColor       =   &H0000FFFF&
  145.                BorderStyle     =   1  'Fixed Single
  146.                DataField       =   "FROM"
  147.                DataSource      =   "Data1"
  148.                BeginProperty Font 
  149.                   name            =   "Arial"
  150.                   charset         =   0
  151.                   weight          =   700
  152.                   size            =   12
  153.                   underline       =   0   'False
  154.                   italic          =   0   'False
  155.                   strikethrough   =   0   'False
  156.                EndProperty
  157.                ForeColor       =   &H80000008&
  158.                Height          =   300
  159.                Left            =   1344
  160.                TabIndex        =   12
  161.                Top             =   192
  162.                Width           =   3180
  163.             End
  164.          End
  165.          Begin Threed.SSCommand Command3D1 
  166.             Height          =   300
  167.             Left            =   288
  168.             TabIndex        =   9
  169.             Top             =   3168
  170.             Width           =   4620
  171.             _Version        =   65536
  172.             _ExtentX        =   8149
  173.             _ExtentY        =   529
  174.             _StockProps     =   78
  175.             Caption         =   "Activate Message"
  176.             ForeColor       =   16711680
  177.             BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  178.                name            =   "Arial"
  179.                charset         =   0
  180.                weight          =   700
  181.                size            =   12
  182.                underline       =   0   'False
  183.                italic          =   0   'False
  184.                strikethrough   =   0   'False
  185.             EndProperty
  186.          End
  187.       End
  188.       Begin VB.Data Data1 
  189.          Appearance      =   0  'Flat
  190.          BackColor       =   &H0000FFFF&
  191.          Caption         =   "Messages"
  192.          Connect         =   ""
  193.          DatabaseName    =   "I:\DATABASE\NUMATIC\postit\NOTES.MDB"
  194.          Enabled         =   0   'False
  195.          Exclusive       =   0   'False
  196.          BeginProperty Font 
  197.             name            =   "Arial"
  198.             charset         =   0
  199.             weight          =   700
  200.             size            =   9.6
  201.             underline       =   0   'False
  202.             italic          =   0   'False
  203.             strikethrough   =   0   'False
  204.          EndProperty
  205.          Height          =   300
  206.          Left            =   192
  207.          Options         =   0
  208.          ReadOnly        =   0   'False
  209.          RecordsetType   =   1  'Dynaset
  210.          RecordSource    =   ""
  211.          Top             =   4224
  212.          Width           =   2316
  213.       End
  214.       Begin Threed.SSCommand updatebutton 
  215.          Height          =   300
  216.          Left            =   2592
  217.          TabIndex        =   7
  218.          Top             =   4224
  219.          Width           =   2700
  220.          _Version        =   65536
  221.          _ExtentX        =   4763
  222.          _ExtentY        =   529
  223.          _StockProps     =   78
  224.          Caption         =   "Check For New Messages"
  225.          ForeColor       =   255
  226.          BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  227.             name            =   "Arial"
  228.             charset         =   0
  229.             weight          =   700
  230.             size            =   9.6
  231.             underline       =   0   'False
  232.             italic          =   0   'False
  233.             strikethrough   =   0   'False
  234.          EndProperty
  235.       End
  236.    End
  237.    Begin VB.TextBox RECORDID 
  238.       Appearance      =   0  'Flat
  239.       Height          =   612
  240.       Left            =   9408
  241.       TabIndex        =   4
  242.       Text            =   "Text1"
  243.       Top             =   7200
  244.       Width           =   2292
  245.    End
  246.    Begin VB.TextBox NAMER 
  247.       Appearance      =   0  'Flat
  248.       Height          =   612
  249.       Left            =   9408
  250.       TabIndex        =   3
  251.       Text            =   "Text1"
  252.       Top             =   6480
  253.       Width           =   2292
  254.    End
  255.    Begin VB.TextBox sounder 
  256.       Appearance      =   0  'Flat
  257.       Height          =   612
  258.       Left            =   9408
  259.       TabIndex        =   2
  260.       Text            =   "Text1"
  261.       Top             =   5760
  262.       Width           =   2292
  263.    End
  264.    Begin VB.TextBox caller 
  265.       Appearance      =   0  'Flat
  266.       Height          =   612
  267.       Left            =   9408
  268.       TabIndex        =   1
  269.       Text            =   "Text1"
  270.       Top             =   5040
  271.       Width           =   2292
  272.    End
  273.    Begin VB.TextBox datum 
  274.       Appearance      =   0  'Flat
  275.       Height          =   492
  276.       Left            =   9408
  277.       MultiLine       =   -1  'True
  278.       TabIndex        =   0
  279.       Text            =   "POSTIT4.frx":030A
  280.       Top             =   4440
  281.       Width           =   2292
  282.    End
  283. Attribute VB_Name = "serverform"
  284. Attribute VB_Creatable = False
  285. Attribute VB_Exposed = False
  286. Private Sub Command3D1_Click()
  287.                    
  288.     ' activate this message !
  289.                    
  290.     ' if data1.caption shows 0 records, then exit
  291.     If Left$(Data1.Caption, 1) = "0" Then Exit Sub
  292.     ' if data1 is not enabled, exit sub
  293.     If Data1.Enabled = False Then Exit Sub
  294.     ' retrieve from the bound controls - and place as if network dde had taken place
  295.     caller.Text = label1.Caption
  296.     NAMER.Text = label1.Caption
  297.     sounder.Text = Data1.Recordset.Fields("sound")
  298.     datum.Text = Data1.Recordset.Fields("message")
  299.     RECORDID.Text = Str$(Data1.Recordset.Fields("record_id"))
  300.     DoEvents
  301.     ' start a new postit note form
  302.     Dim POSTIT As New POSTIT
  303.     ' fill in the details
  304.     POSTIT.datum.Text = datum.Text
  305.     POSTIT.status.Caption = "FROM : " + caller.Text + " - " + Format$(Time, "hh-mm")
  306.     POSTIT.NAMER.Text = NAMER.Text
  307.     POSTIT.RECORDID = RECORDID.Text
  308.     POSTIT.messagenumber.Caption = "Message #" + RECORDID.Text
  309.     ' WANT TO PLAY A SOUND...
  310.     SoundName$ = (sounder.Text)
  311.     X% = sndPlaySound(ByVal SoundName$, 1)
  312.     ' show the postit
  313.     POSTIT.Show
  314. End Sub
  315. Private Sub Data1_Error(DATAERR As Integer, response As Integer)
  316.     A = MsgBox("There are no more entries in the queue !", 64, "For your information")
  317.     response = 0
  318. End Sub
  319. Private Sub Data1_Reposition()
  320.     Data1.Caption = Trim$(Str$(Data1.Recordset.RecordCount)) + " Messages"
  321.     DoEvents
  322. End Sub
  323. Private Sub Form_LinkExecute(cmdstr As String, CANCEL As Integer)
  324.     ' we are being hailed !  (beam me up scotty)
  325.     ' two commands are in use for this server, OK and CLOSE
  326.     If cmdstr = "OK" Then
  327.         
  328.         ' start a new postit form
  329.         Dim POSTIT As New POSTIT
  330.         ' fill in the details
  331.         POSTIT.datum.Text = datum.Text
  332.         POSTIT.status.Caption = caller.Text + " - " + Format$(Time, "hh-mm")
  333.         POSTIT.NAMER.Text = NAMER.Text
  334.         POSTIT.RECORDID.Text = RECORDID.Text
  335.         POSTIT.messagenumber.Caption = "Message #" + RECORDID.Text
  336.         ' WANT TO PLAY A SOUND...
  337.         SoundName$ = (sounder.Text)
  338.         X% = sndPlaySound(ByVal SoundName$, 1)
  339.         ' show the form
  340.         POSTIT.Show
  341.     Else
  342.         
  343.         If cmdstr = "CLOSE" Then
  344.             
  345.             ' close me down !
  346.             Unload Me
  347.         End If
  348.     End If
  349.     CANCEL = 0
  350. End Sub
  351. Private Sub Form_Resize()
  352.     ' kludge to disable or enable the data1 control.
  353.     If WindowState = 1 Then
  354.         Data1.Enabled = False
  355.         DoEvents
  356.         Label2.Caption = "Click on 'Check For New Messages' below to access your message queue (There may not be any messages though !)"
  357.         label1.Caption = ""
  358.         
  359.     End If
  360. End Sub
  361. Private Sub updatebutton_Click()
  362.     ' go check for new messages
  363.     Data1.RecordSource = "SELECT * FROM NOTELOG WHERE USERNAME = '" + Environ$("WINNAME") + "' AND READ = FALSE ORDER BY DATE DESC"
  364.     Data1.Enabled = True
  365.     Data1.Refresh
  366. End Sub
  367.